﻿#ifndef _DB_IFEATUREITERATOR_H
#define _DB_IFEATUREITERATOR_H

#include "udatabase/interface/ifeature.h"
#include "kernel/Referenced.h"
#include "udatabase/dll_cfg.h"

namespace FD
{
	namespace Utility
	{
		namespace DB
		{
			namespace Interface
			{
			/// <summary>
			/// 要素查询结果迭代器，用于遍历查询结果，只能向前移动，不可后退。
			/// </summary>
			class FD_DB_Export IFeatureIterator : public FD::Kernel::CReferenced
			{
			public:
				/// <summary>
				/// 默认析构函数
				/// </summary>
				virtual ~IFeatureIterator();
			public:
				/// <summary>
				/// 下一个结果
				/// </summary>
				/// <returns>如果移动到最后，返回NULL；否则，返回值有效</returns>
				virtual FD::Utility::DB::Interface::IFeature* next();
				/// <summary>
				/// 获取查询结果集中的要素字段
				/// </summary>
				/// <returns>字段集合</returns>
				virtual const FD::Utility::DB::Interface::IFields* getFields() const;
				/// <summary>
				/// 获取指定索引的字段
				/// </summary>
				/// <param name="index">指定索引</param>
				/// <returns>ture，成功；false，失败</returns>
				virtual const FD::Utility::DB::Interface::IField* getField(UINT32 index) const;
				/// <summary>
				/// 能否找到指定字段名称
				/// </summary>
				/// <param name="fieldName">字段名称</param>
				/// <returns>如果找到，返回索引；如果找不到，返回-1</returns>
				virtual INT32 findField(const String& fieldName) const;

			protected:
				/// <summary>
				/// 默认构造函数
				/// </summary>
				IFeatureIterator();
			private:
				/// <summary>
				/// 拷贝构造函数
				/// </summary>
				C_DISABLE_COPY(IFeatureIterator);
			};
		}
	}
	}
}

#endif
